<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outerBox {
            width: 400px;
            height: 100px;
            border: 10px solid black;
            ;
        }

        .outerBox>div {
            width: 100px;
            height: 100px;
            background: orange;
            float: left;
        }

        .outerBox>.end {
            width: 100px
        }
        .outerBoxTwo {
            width: 400px;
            height: 100px;
            border: 10px solid red;
        }
        /* 浮动可以让行内元素变为块元素 */
        .outBoxTwo>span {
            width: 100px;
            height: 100px;
            background: red;
            float:left;
        }

        /* 如果存在不浮动的元素在浮动元素中，不浮动元素会被浮动元素盖住 */
        .outBoxTwo>.end {
            width: 100px;
            height: 120px;
            background: yellow;
            /* float: left; */
        }
    </style>
</head>

<body>

    <!-- 
    浮动布局：float: left|right|none
    如果取值为 left, 则元素会以此从左向右横向排列，当大小超出横向范围则自动掉落到下一行。
    -->
    <div class="outerBox">
        <div>1</div>
        <div>2</div>
        <div>3</div>
        <div class="end">4</div>
    </div>
    <div class="outBoxTwo">
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <div class="end">1234</div> <!-- 没有浮动 -->
    </div>

</body>

</html>